<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>推荐人信息</title>
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<meta name="format-detection" content="telephone=no">
<script src="__PUBLIC__/wap/js/flexible.js"></script>
<link href="__PUBLIC__/wap/css/mobiscroll.custom-2.5.0.min.css" rel="stylesheet" type="text/css"/>
<link href="__PUBLIC__/wap/css/icons.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/wap/css/base.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/wap/css/member.css" />
</head>
<body class="login">
<div class="head">
	<a  href="javascript:history.go(-1);"  >
		<button class="md-close back"><i class="iconfont">&#xe617</i></button>
	</a>
	<!--<a href="#" class="md-login floatRgt">登录</a>-->
	<h2>推荐人信息</h2>
</div>
<div id="loginForm" class="mlogin" >	<div class="other-link">
		请确认您的推荐人或店铺信息
	</div>
	<div class="field">
		<div class="label">
			推荐人
		</div>
		<div class="field-control">
			<input type="text" class="input-required" name="username" readonly placeholder="请输入您的推荐人" value="{$data.recommend_name}" id="shopname">
		</div>
	</div>
	<div class="field" style="display: none">
		<div class="label">
			旗舰店
		</div>
		<div class="field-control">
			<input type="text"  class="input-required" name="repassword"  readonly placeholder="请输入您的推荐旗舰店" value="{$data.flageship}" id="repassword">
		</div>
	</div>

	
	<div class="submit">
		<button type="submit" class="button" id="submit-btn" onclick="javascript:void(0);">下一步</button>
	</div>

</div>
<script type="text/javascript" src="__PUBLIC__/wap/js/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/layer/layer.js"></script>
<script>
	//定义一个产生订单请求的变量
	var levelId={$data.levelId};

	var options = {
		url: "<?php echo U('wap/start/start_set_order'); ?>",
		type: "post",
		data:{'levelId':levelId},
		dataType: 'json',
		target: "#loader",
		error: function () {
			layer.msg("服务器没有返回数据，可能服务器忙，请重试", {icon: 5});
		},
		onwait: "正在处理信息，请稍候...",
		success: function (response) {
			console.log(response);
			if (response.status == 1) {
				window.location.href = "<?php echo U('wap/start/start_pay'); ?>?pay_sn=" + response.pay_sn;
			} else if (response.status == 2) {
				//未绑定 手机
				layer.msg(response.error, {icon: 5, time: 2000}, function () {
					get_binding();
				});

			} else {
				//alert(response.error);
				if (response.error) {
					layer.msg(response.error, {icon: 5});
				} else {
					layer.msg('该订单已提交', {icon: 5});
				}
			}
		}
	};
	$("#submit-btn").click(function () {

		if (!levelId) {
			layer.msg('开店信息错误', {icon: 5});
			//alert("商品信息错误");
		} else {
			binding_is_check = 1;
			setTimeout(function () {
				$.ajax(options);
			}, 300);
		}
	});

</script>

<!-- mobiscroll star-->

<!-- mobiscroll end-->

<!--微信分享-->
<include file="Public/share_weixin"/>
</body>
</html>